package com.zc.im.mapper.im.group;

import com.zc.im.model.im.group.ZcImGroupComment;
import com.zc.im.model.im.group.ZcImGroupCommentExample;
import com.zc.im.model.im.group.ZcImGroupCommentKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcImGroupCommentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int countByExample(ZcImGroupCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int deleteByExample(ZcImGroupCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_im_group_comment",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcImGroupCommentKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_im_group_comment (id, group_id, ",
        "log_id, content, ",
        "comment_user_id, comment_sort, ",
        "company_id, created_time, ",
        "updated_time, status)",
        "values (#{id,jdbcType=INTEGER}, #{groupId,jdbcType=INTEGER}, ",
        "#{logId,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, ",
        "#{commentUserId,jdbcType=INTEGER}, #{commentSort,jdbcType=INTEGER}, ",
        "#{companyId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, ",
        "#{updatedTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcImGroupComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int insertSelective(ZcImGroupComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    List<ZcImGroupComment> selectByExample(ZcImGroupCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, group_id, log_id, content, comment_user_id, comment_sort, company_id, created_time, ",
        "updated_time, status",
        "from zc_im_group_comment",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcImGroupComment selectByPrimaryKey(ZcImGroupCommentKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcImGroupComment record, @Param("example") ZcImGroupCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcImGroupComment record, @Param("example") ZcImGroupCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcImGroupComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_comment
     *
     * @mbggenerated
     */
    @Update({
        "update zc_im_group_comment",
        "set group_id = #{groupId,jdbcType=INTEGER},",
          "log_id = #{logId,jdbcType=INTEGER},",
          "content = #{content,jdbcType=VARCHAR},",
          "comment_user_id = #{commentUserId,jdbcType=INTEGER},",
          "comment_sort = #{commentSort,jdbcType=INTEGER},",
          "company_id = #{companyId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcImGroupComment record);
}